﻿@functions
{
    private string GetSearchField(IEnumerable<dynamic> dataList)
    {
        string rv = "";
        IEnumerable<dynamic> rows = dataList.Where(c => c.SearchType != "");
        string name, remark,searchType, valueType;
        foreach (dynamic item in rows)
        {
            name = item.Name;
            remark = item.Remark;
            searchType = item.SearchType;
            valueType= item.ValueType;
            rv += "<option value=\"" + name + "\" valueType=\"" + valueType + "\" searchType=\"" + searchType +"\">" + remark + "</option>";
        }
        return rv;
    }
}
@{
    IEnumerable<dynamic> dataList = Model;
    string options = "";
    if (dataList != null)
    {
        options = GetSearchField(dataList);
    }
    if (options!= "")
    {
          @Html.Raw(options)
    }
}

